#coding:utf-8
from lovewith.utils.mtcache import MtCache
from lovewith.website.models import Website


class WebSiteApi:
    def __init__(self):
        pass

    #获取全部连接
    @staticmethod
    def get_all():
        site_data = MtCache('site').get()
        if not site_data:
            site_filter_data = Website.objects.get(id=1)
            site_data = {
                'title': site_filter_data.title,
                'keyword': site_filter_data.keyword,
                'description': site_filter_data.description
            }

            MtCache('site').set(site_data)

        return site_data